#include<stdio.h>
int removeElement(int* nums, int numsSize, int val) {
    if (nums == NULL) {
        return 0;
    }
    int i = numsSize - 1, j = 0;
    while (j >= 0) {
        if (nums[i] == val) {
            j = i - 1;
            while (nums[i] != NULL) {
                nums[i] = nums[i + 1];
                i++;
            }
            numsSize--;
        }
        i = j;
    }
    return numsSize;
}
void main() {
   int num[6] = { 1,2,3,4,4,5 };
   int a = removeElement(num, 6, 4);
   printf("%d", a);
}